import { SET_TOKEN } from '../actionTypes/token'
import { getToken } from '@/utils/token'

const token = getToken() || ''

const reducer = (initState = token, action) => {
  switch (action.type) {
    case SET_TOKEN:
      return action.payload

    default:
      return initState
  }
}

export default reducer
